package com.example.will.blueserver.utils;

/**
 * Created by Lzz on 12/7/2017.
 */

public class BytesUtils {


    /**
     * byte[] 转为16进制String
     */
    public static String Bytes2HexString(byte[] b) {
        String ret = "";
        for (int i = 0; i < b.length; i++) {
            String hex = Integer.toHexString(b[i] & 0xFF);
            if (hex.length() == 1) {
                hex = '0' + hex;
            }
            ret += hex.toUpperCase();
        }
        return ret;
    }

}
